home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 August: Tool Chest / Dev.CD Aug 00 TC Disk 2.toast / pc / sample code / quicktime / quicktime vr / vrscript.win / vrscript.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-06-23  |  28.6 KB  |  576 lines

  1. //////////
  2. //
  3. //    File:        VRScript.h
  4. //
  5. //    Contains:    Header file for external script file processing.
  6. //
  7. //    Written by:    Tim Monroe
  8. //
  9. //    Copyright:    © 1997 by Apple Computer, Inc., all rights reserved.
  10. //
  11. //    Change History (most recent first):
  12. //
  13. //       <2>         04/17/97        rtm        revised structures slightly
  14. //       <1>         03/06/97        rtm        first file
  15. //       
  16. //////////
  17.  
  18. #pragma once
  19.  
  20.  
  21. //////////
  22. //
  23. // header files
  24. //       
  25. //////////
  26.  
  27. #include "ComApplication.h"
  28.  
  29. #if TARGET_OS_MAC
  30. #include "MacFramework.h"
  31. #endif
  32.  
  33. #if TARGET_OS_WIN32
  34. #include "WinFramework.h"
  35. #endif
  36.  
  37. #if !SOUNDSPROCKET_AVAIL
  38. typedef    long                SSpSourceReference;
  39. typedef    long                SSpListenerReference;
  40. #endif    
  41.  
  42. #include "VR3DTexture.h"
  43.  
  44.  
  45. //////////
  46. //
  47. // constants
  48. //       
  49. //////////
  50.  
  51. // remove the following when the QTVR headers are updated
  52. #define kQTVRBackBufferHorizontal    1L << 3
  53.  
  54.  
  55. #define kDefaultScriptFileName    "myScript"    // default name of the script file
  56.  
  57. #define kMaxCmdLineLength        512            // maximum length, in bytes, of a command line
  58. #define kMaxCmdWordLength        32            // maximum length, in bytes, of a command word
  59. #define kMaxVarNameLength        32            // maximum length, in bytes, of a variable name
  60. #define kMaxVarOpLength            3            // maximum length, in bytes, of a variable operation
  61.  
  62. #if TARGET_OS_MAC
  63. #define kMaxFileNameLength        64            // maximum length, in bytes, of a file name
  64. #define kOffscreenPixelType        k32ARGBPixelFormat
  65. #endif
  66. #if TARGET_OS_WIN32
  67. #define kMaxFileNameLength        MAX_PATH    // maximum length, in bytes, of a file name
  68. #define kOffscreenPixelType        k32BGRAPixelFormat
  69. #endif
  70.  
  71. #define kRadianTolerance        0.001        // how close two floating-point radian values must be for us to count them equal
  72.  
  73. #define kMaxOSTypeLength        5            // maximum length, in bytes, of an OSType (plus terminating null character)
  74.  
  75. // values for fOptions field of sound or movie entry
  76. enum {
  77.     kVRMedia_PlayNew        = 0,            // start the media playing (whether it's already playing or not)
  78.     kVRMedia_Restart        = 1,            // stop the media if already playing, then start the media playing
  79.     kVRMedia_ToggleStop        = 2,            // toggle between play and stop/remove
  80.     kVRMedia_Continue        = 3,            // start the media playing if it's not playing, ignore otherwise
  81.     kVRMedia_Stop            = 4,            // stop the media playing
  82.     kVRMedia_TogglePause    = 5                // toggle between play and pause
  83. };
  84.  
  85. // values for fOptions field of localized sound entry
  86. enum {
  87.     kVRPlay_Loop            = 0,
  88.     kVRPlay_Once            = 1
  89. };
  90.  
  91. // values for fSoundContainer field of a sound entry
  92. enum {
  93.     kVRSound_SoundResource    = (UInt32)0,    // sound container is a sound resource (of type 'snd ')
  94.     kVRSound_AIFFFile        = (UInt32)1,    // sound container is an AIFF file
  95.     kVRSound_WAVEFile        = (UInt32)2,    // sound container is a WAVE file
  96.     kVRSound_URL            = (UInt32)3,    // sound container is a URL
  97.     kVRSound_SoundFile        = (UInt32)4        // sound container is a sound file (of type 'sfil' and creator 'movr');
  98.                                             // this is never used, since we just play the contained sound resource.
  99. };
  100.  
  101. // values for theOptions parameter of VRSound_DumpSelectedSounds and VRMoov_DumpSelectedSounds
  102. enum {
  103.     kVRSelect_Node            = 0,
  104.     kVRSelect_Scene            = 1
  105. };
  106.  
  107. // special values for fMaxExecutions field of command entries
  108. enum {
  109.     kVRDoIt_Forever            = -1
  110. };
  111.  
  112. // values for fOptions field of angle (and other) commands
  113. enum {
  114.     kVRValue_Absolute        = 0,
  115.     kVRValue_Relative        = 1
  116. };
  117.  
  118. // values for fOptions field of controller bar command (and for some state parameters)
  119. enum {
  120.     kVRState_Hide            = 0,
  121.     kVRState_Show            = 1,
  122.     kVRState_Toggle            = 2
  123. };
  124.  
  125. // values for fOptions field of timed commands
  126. enum {
  127.     kVROrphan_LetLive        = 0,
  128.     kVROrphan_Kill            = 1
  129. };
  130.  
  131. // values for Button parameter of SetButtonState command
  132. enum {
  133.     kVRButton_Step            = 0,            // QuickTime step buttons; not supported by VR controller
  134.     kVRButton_Speaker        = 1,            // speaker button
  135.     kVRButton_GoBack        = 2,            // go-back button
  136.     kVRButton_ZoomInOut        = 3,            // zoom buttons
  137.     kVRButton_ShowHotSpots    = 4,            // show hot spots button
  138.     kVRButton_Translate        = 5,            // translate button
  139.     kVRButton_HelpText        = 6,            // help text; not really a button, but same interface works
  140.     kVRButton_HotSpotNames    = 7,            // hot spot names; not really a button, but same interface works
  141.     kVRButton_Custom        = 8                // the custom button
  142. };
  143.  
  144. // values for fOptions field of PlayTransMovie command
  145. enum {
  146.     kVRMovie_PlayAll        = 0,
  147.     kVRMovie_PlayTilClick    = 1
  148. };
  149.  
  150. // values for Mode parameter of SetPanTiltZoom command
  151. enum {
  152.     kVRTransition_Jump        = 0,            // jump from current pan/tilt/fov to new values
  153.     kVRTransition_Swing        = 1,            // swing from current pan/tilt/fov to new values 
  154.     kVRTransition_SwingWait    = 2                // swing from current pan/tilt/fov to new values and wait until done
  155. };
  156.  
  157. // special values for fBoxHeight and fBoxWidth fields of picture overlay entry
  158. #define kVRUseMovieHeight    32000
  159. #define kVRUseMovieWidth    32000
  160.  
  161. // special values for NodeID parameter of many commands
  162. #define kVRAnyNode            (UInt32)-1
  163.  
  164. // bit flags for fPegSides field of picture overlay entry
  165. enum {
  166.     kPegSide_Left            = (1L << 0),
  167.     kPegSide_Top            = (1L << 1),
  168.     kPegSide_Right            = (1L << 2),
  169.     kPegSide_Bottom            = (1L << 3)
  170. };
  171.  
  172. // values for fMode field of timed command entry
  173. enum {
  174.     kVRUseAbsoluteTime        = 0,            // time is relative to application launch
  175.     kVRUseNodeTime            = 1,            // time is relative to node entry
  176.     kVRUseInstallTime        = 2                // time is relative to command installation
  177. };
  178.  
  179. // values for NameType parameter of some commands
  180. enum {
  181.     kVRAbsolutePath            = 0,            // path is absolute
  182.     kVRRelativePath            = 1,            // path is relative
  183.     kVRAbsoluteURL            = 2,            // URL is absolute
  184.     kVRRelativeURL            = 3                // URL is relative
  185. };
  186.  
  187. // resource IDs for undefined hot spots ('undf', other undefined, or missing type)
  188. #define kCursID_MouseOverUndefHS    -19687
  189. #define kCursID_MouseDownOnUndefHS    -19686
  190. #define kCursID_MouseUpOnUndefHS    -19685
  191.  
  192. // values for fEntryType field of any list entry
  193. // IMPORTANT: the values for implemented list types MUST be sequential!
  194. enum {
  195.     kVREntry_Generic            = 0,    // a generic list entry
  196.     kVREntry_Sound                = 1,    // a sound list entry
  197.     kVREntry_QTMovie            = 2,    // a QuickTime movie list entry
  198.     kVREntry_QD3DObject            = 3,    // a QuickDraw 3D object list entry
  199.     kVREntry_OverlayPicture        = 4,    // a picture overlay list entry
  200.     kVREntry_TimedCommand        = 5,    // a timed command list entry
  201.     kVREntry_QuitCommand        = 6,    // a quitting command list entry
  202.     kVREntry_MouseOverHS        = 7,    // a mouse-over hot spot command list entry
  203.     kVREntry_ClickHS            = 8,    // a click hot spot command list entry
  204.     kVREntry_ClickCustom        = 9,    // a click custom button command list entry
  205.     kVREntry_ClickSprite        = 10,    // a click sprite command list entry
  206.     kVREntry_NodeEntry            = 11,    // a node-entry command list entry
  207.     kVREntry_NodeExit            = 12,    // a node-exit command list entry
  208.     kVREntry_PanAngleCmd        = 13,    // a pan angle command list entry
  209.     kVREntry_TiltAngleCmd        = 14,    // a tilt angle command list entry
  210.     kVREntry_FOVAngleCmd        = 15,    // a zoom angle command list entry
  211.     kVREntry_Variable            = 16,    // a variable list entry
  212.     kVREntry_TransitionEffect    = 17,    // a QuickTime video effect transition list entry    
  213.     kVREntry_EmbedPicture        = 18,    // a picture embedded in a panorama
  214.     kVREntry_VRObjectMovie        = 19,    // a QuickTime VR object movie list entry    
  215.     kVREntry_Unknown            = 100    // an unknown list entry
  216. };
  217.  
  218. #define kVRScript_FirstEntryType    kVREntry_Sound
  219. #define kVRScript_FinalEntryType    kVREntry_TransitionEffect
  220.  
  221.  
  222. //////////
  223. //
  224. // data structures
  225. //       
  226. //////////
  227.  
  228. // most of our script data is kept in a linked list of the appropriate type;
  229. // here are the various types:
  230.  
  231. // a generic list entry head
  232. typedef struct VRScriptGeneric {
  233.     UInt32                        fEntryType;            // kVREntry_Generic
  234.     UInt32                        fEntryID;            // a unique identifier for this entry
  235.     void                        *fNextEntry;        // the next entry in the list
  236.     UInt32                        fNodeID;            // the ID of the relevant node
  237.     UInt32                        fOptions;
  238.     SInt32                        fMaxExecutions;        // the maximum number of times command is executed
  239. } VRScriptGeneric, *VRScriptGenericPtr;
  240.  
  241.  
  242. // a list entry for our sound linked list
  243. // NOTE: this list contains only sounds for the current node or that are scene-wide (to be played in all nodes)
  244. typedef struct VRScriptSound {
  245.     UInt32                        fEntryType;            // kVREntry_Sound
  246.     UInt32                        fEntryID;            // a unique identifier for this entry
  247.     struct VRScriptSound        *fNextEntry;        // the next entry in the list
  248.     UInt32                        fNodeID;            // the node ID (either current node or kVRAnyNode)
  249.     UInt32                        fOptions;            // user interaction options
  250.     UInt32                        fMode;                // the loop mode (0 == no loop; 1 == loop)
  251.     UInt32                        fSoundContainer;    // the sound's container (resource? AIFF file? etc.)
  252.     UInt32                        fResID;                // the 'snd ' resource ID for the sound
  253.     SndListHandle                fResourceData;        // the 'snd ' resource data for the sound
  254.     short                        fRefNum;            // the file reference number, for file-based sounds
  255.     SndChannelPtr                fChannel;            // the sound channel
  256.     Boolean                        fSoundIsPlaying;    // is the sound (still) playing?
  257.     Boolean                        fFadeWhenStopping;    // should we fade sound out when we stop it?
  258.     Boolean                        fSoundIsLocalized;    // is the sound localized?
  259.     TQ3Point3D                    fLocation;            // the location of the sound
  260.     float                        fProjAngle;            // the angle within which the sound can be heard
  261.     SSpSourceReference            fSource;            // the sound source
  262. } VRScriptSound, *VRScriptSoundPtr;
  263.  
  264.  
  265. // a list entry for our 3D object linked list
  266. typedef struct VRScript3DObj {
  267.     UInt32                        fEntryType;            // kVREntry_QD3DObject
  268.     UInt32                        fEntryID;            // a unique identifier for this entry
  269.     struct VRScript3DObj        *fNextEntry;        // the next entry in the list
  270.     UInt32                        fNodeID;            // (unused here)    
  271.     UInt32                        fOptions;
  272.     TQ3GroupObject                fModel;                // the 3D object in the scene being modelled
  273.     TQ3StyleObject                fInterpolation;        // interpolation style used when rendering
  274.     TQ3StyleObject                fBackFacing;        // whether to draw shapes that face away from the camera
  275.     TQ3StyleObject                fFillStyle;            // whether drawn as solid filled object or decomposed to components
  276.     TQ3Matrix4x4                fRotation;            // the transform for the model
  277.     TQ3Vector3D                    fRotateFactors;        // the x, y, and z rotation factors
  278.     TQ3Point3D                    fGroupCenter;        // the center of the group
  279.     float                        fGroupScale;        // scaling factor to apply before drawing
  280.     TextureHdl                    fTexture;            // the texture for the 3D object
  281.     Boolean                        fTextureIsMovie;    // is the texture from a QuickTime movie?
  282.     Boolean                        fModelIsVisible;    // is the 3D object visible?
  283.     Boolean                        fModelIsAnimated;    // is the 3D object being animated?
  284. } VRScript3DObj, *VRScript3DObjPtr;
  285.  
  286.  
  287. // a list entry for our picture overlay linked list
  288. // NOTE: this list contains only pictures for the current node
  289. typedef struct VRScriptPicture {
  290.     UInt32                        fEntryType;            // kVREntry_OverlayPicture
  291.     UInt32                        fEntryID;            // a unique identifier for this entry
  292.     struct VRScriptPicture        *fNextEntry;        // the next entry in the list
  293.     UInt32                        fNodeID;            // (unused here)    
  294.     UInt32                        fOptions;
  295.     UInt32                        fResID;                // the 'PICT' resource ID for the picture
  296.     UInt32                        fBoxHeight;            // height of the display rectangle
  297.     UInt32                        fBoxWidth;            // width of the display rectangle
  298.     UInt32                        fPegSides;            // side(s) to which display rectangle is pegged
  299.     UInt32                        fOffset;            // offset of display rectangle from pegged side(s)
  300.     PicHandle                    fResourceData;        // the 'PICT' resource data for the picture
  301. } VRScriptPicture, *VRScriptPicturePtr;
  302.  
  303.  
  304. // a list entry for our time-based command linked list
  305. typedef struct VRScriptAtTime {
  306.     UInt32                        fEntryType;            // kVREntry_TimedCommand
  307.     UInt32                        fEntryID;            // a unique identifier for this entry
  308.     struct VRScriptAtTime        *fNextEntry;        // the next entry in the list
  309.     UInt32                        fNodeID;        
  310.     UInt32                        fOptions;
  311.     SInt32                        fMaxExecutions;        // the maximum number of times command is executed
  312.     UInt32                        fTime;
  313.     UInt32                        fMode;                // 0 == absolute time; 1 == node-relative time; 2 == install-relative
  314.     float                        fTimeInstalled;        // the time (in ticks) when entry installed
  315.     char                        *fCommandLine;
  316.     Boolean                        fRepeat;            // does this command repeat?
  317.     UInt32                        fPeriod;            // the interval (in ticks) of repeating
  318. } VRScriptAtTime, *VRScriptAtTimePtr;
  319.  
  320.  
  321. // a list entry for our quitting time command linked list
  322. typedef struct VRScriptAtQuit {
  323.     UInt32                        fEntryType;            // kVREntry_QuitCommand
  324.     UInt32                        fEntryID;            // a unique identifier for this entry
  325.     struct VRScriptAtQuit        *fNextEntry;        // the next entry in the list
  326.     UInt32                        fNodeID;            // (unused here)    
  327.     UInt32                        fOptions;
  328.     char                        *fCommandLine;
  329. } VRScriptAtQuit, *VRScriptAtQuitPtr;
  330.  
  331.  
  332. // a list entry for our mouse-over hot spot command linked list
  333. typedef struct VRScriptAtMOHS {
  334.     UInt32                        fEntryType;            // kVREntry_MouseOverHS
  335.     UInt32                        fEntryID;            // a unique identifier for this entry
  336.     struct VRScriptAtMOHS        *fNextEntry;        // the next entry in the list
  337.     UInt32                        fNodeID;        
  338.     UInt32                        fOptions;            // the hot spot action selector (see VRPWQTVR2.0, p.1-39)
  339.     SInt32                        fMaxExecutions;        // the maximum number of times command is executed
  340.     Boolean                        fSelectByID;        // do we want hot spots targeted by ID (true) or type (false)?
  341.     UInt32                        fHotSpotID;            // the target hot spot ID; must be 0 if fSelectByID == false
  342.     OSType                        fHotSpotType;        // the target hot spot type; must be 0 if fSelectByID == true
  343.     char                        *fCommandLine;
  344. } VRScriptAtMOHS, *VRScriptAtMOHSPtr;
  345.  
  346.  
  347. // a list entry for our hot spot click command linked list
  348. typedef struct VRScriptClickHS {
  349.     UInt32                        fEntryType;            // kVREntry_ClickHS
  350.     UInt32                        fEntryID;            // a unique identifier for this entry
  351.     struct VRScriptClickHS        *fNextEntry;        // the next entry in the list
  352.     UInt32                        fNodeID;        
  353.     UInt32                        fOptions;            // do we prevent a link hot spot from triggering?
  354.     SInt32                        fMaxExecutions;        // the maximum number of times command is executed
  355.     Boolean                        fSelectByID;        // do we want hot spots targeted by ID (true) or type (false)?
  356.     UInt32                        fHotSpotID;            // the target hot spot ID; must be 0 if fSelectByID == false
  357.     OSType                        fHotSpotType;        // the target hot spot type; must be 0 if fSelectByID == true
  358.     char                        *fCommandLine;
  359. } VRScriptClickHS, *VRScriptClickHSPtr;
  360.  
  361.  
  362. // a list entry for our custom button click command linked list
  363. typedef struct VRScriptClickCustom {
  364.     UInt32                        fEntryType;            // kVREntry_ClickCustom
  365.     UInt32                        fEntryID;            // a unique identifier for this entry
  366.     struct VRScriptClickCustom    *fNextEntry;        // the next entry in the list
  367.     UInt32                        fNodeID;        
  368.     UInt32                        fOptions;            // (unused here)
  369.     SInt32                        fMaxExecutions;        // the maximum number of times command is executed
  370.     char                        *fCommandLine;
  371. } VRScriptClickCustom, *VRScriptClickCustomPtr;
  372.  
  373.  
  374. // a list entry for our sprite click command linked list
  375. typedef struct VRScriptClickSprite {
  376.     UInt32                        fEntryType;            // kVREntry_ClickSprite
  377.     UInt32                        fEntryID;            // a unique identifier for this entry
  378.     struct VRScriptClickSprite    *fNextEntry;        // the next entry in the list
  379.     UInt32                        fNodeID;        
  380.     UInt32                        fOptions;            // the sprite's atom ID
  381.     SInt32                        fMaxExecutions;        // the maximum number of times command is executed
  382.     char                        *fCommandLine;
  383. } VRScriptClickSprite, *VRScriptClickSpritePtr;
  384.  
  385.  
  386. // a list entry for our node-entry command linked list
  387. typedef struct VRScriptNodeIn {
  388.     UInt32                        fEntryType;            // kVREntry_NodeEntry
  389.     UInt32                        fEntryID;            // a unique identifier for this entry
  390.     struct VRScriptNodeIn        *fNextEntry;        // the next entry in the list
  391.     UInt32                        fNodeID;        
  392.     UInt32                        fOptions;
  393.     SInt32                        fMaxExecutions;        // the maximum number of times command is executed
  394.     char                        *fCommandLine;
  395. } VRScriptNodeIn, *VRScriptNodeInPtr;
  396.  
  397.  
  398. // a list entry for our node-exit command linked list
  399. typedef struct VRScriptNodeOut {
  400.     UInt32                        fEntryType;            // kVREntry_NodeExit
  401.     UInt32                        fEntryID;            // a unique identifier for this entry
  402.     struct VRScriptNodeOut        *fNextEntry;        // the next entry in the list
  403.     UInt32                        fNodeID;            // (unused here)    
  404.     UInt32                        fOptions;            // 1 == cancel the node exiting; 0 == exit the node
  405.     SInt32                        fMaxExecutions;        // the maximum number of times command is executed
  406.     SInt32                        fFromNodeID;
  407.     SInt32                        fToNodeID;
  408.     char                        *fCommandLine;
  409. } VRScriptNodeOut, *VRScriptNodeOutPtr;
  410.  
  411.  
  412. // a list entry for our angle-based command linked list
  413. typedef struct VRScriptAtAngle {
  414.     UInt32                        fEntryType;            // kVREntry_PanAngleCmd, kVREntry_TiltAngleCmd, or kVREntry_FOVAngleCmd
  415.     UInt32                        fEntryID;            // a unique identifier for this entry
  416.     struct VRScriptAtAngle        *fNextEntry;        // the next entry in the list
  417.     UInt32                        fNodeID;    
  418.     UInt32                        fOptions;
  419.     SInt32                        fMaxExecutions;        // the maximum number of times command is executed
  420.     float                        fMinAngle;
  421.     float                        fMaxAngle;
  422.     char                        *fCommandLine;
  423. } VRScriptAtAngle, *VRScriptAtAnglePtr;
  424.  
  425.  
  426. // a list entry for our QuickTime movie linked list
  427. typedef struct VRScriptMovie {
  428.     UInt32                        fEntryType;            // kVREntry_QTMovie
  429.     UInt32                        fEntryID;            // a unique identifier for this entry
  430.     struct VRScriptMovie        *fNextEntry;        // the next entry in the list
  431.     UInt32                        fNodeID;            // the node ID (either current node or kVRAnyNode)
  432.     UInt32                        fOptions;            // user interaction options
  433.     UInt32                        fMode;                // loop or play once
  434.     Movie                        fMovie;                // the embedded movie to play
  435.     GWorldPtr                    fMovieGWorld;        // the offscreen graphics world used for imaging embedded movies
  436.     PixMapHandle                fMoviePixMap;        // the pixmap of the offscreen graphics world
  437.     QTVRFloatPoint                fMovieCenter;        // the center in the panorama of the movie screen (in angles: x = pan; y = tilt)
  438.     Rect                        fMovieRect;            // the height and width of the embedded movie (in coordinates)
  439.     float                        fMovieScale;        // a scale factor for the movie rectangle
  440.     float                        fMovieWidth;        // the width (in radians) of the embedded movie; if 0, movie has no video track
  441.     Boolean                        fUseMovieGWorld;    // use the specified movie GWorld?
  442.     Boolean                        fUseMovieCenter;    // use the specified movie center?
  443.     Boolean                        fQTMovieHasSound;    // does the embedded movie have a sound track?
  444.     Boolean                        fQTMovieHasVideo;    // does the embedded movie have a video track?
  445.     Boolean                        fCompositeMovie;    // does the embedded movie need to be composited?
  446.     Boolean                        fUseHideRegion;        // use the specified movie hide region?
  447.     RGBColor                    fChromaColor;        // the color for chroma key compositing
  448.     RgnHandle                    fHideRegion;        // the region that obscures the embedded movie video track
  449.     Boolean                        fSoundIsLocalized;    // is the movie sound localized?
  450.     Boolean                        fDoRotateMovie;        // should we rotate the movie?
  451.     float                        fVolAngle;            // the half angle of the movie attenuation cone
  452.     MediaHandler                fMediaHandler;        // the sound media handler
  453.     char                        *fPathname;
  454. } VRScriptMovie, *VRScriptMoviePtr;
  455.  
  456.  
  457. // a list entry for our variables linked list
  458. typedef struct VRScriptVariable {
  459.     UInt32                        fEntryType;            // kVREntry_Variable
  460.     UInt32                        fEntryID;            // (unused here)
  461.     struct VRScriptVariable        *fNextEntry;        // the next entry in the list
  462.     UInt32                        fNodeID;            // (unused here)
  463.     SInt32                        fValue;                // the value of the variable
  464.     SInt32                        fMaxExecutions;        // (unused here)
  465.     char                        *fVarName;            // the name of the variable
  466. } VRScriptVariable, *VRScriptVariablePtr;
  467.  
  468.  
  469. // a list entry for our QuickTime video effects transitions linked list
  470. typedef struct VRScriptTransition {
  471.     UInt32                        fEntryType;            // kVREntry_TransitionEffect
  472.     UInt32                        fEntryID;            // (unused here)
  473.     struct VRScriptTransition    *fNextEntry;        // the next entry in the list
  474.     UInt32                        fNodeID;            // (unused here)
  475.     UInt32                        fOptions;            //
  476.     SInt32                        fMaxExecutions;        // the maximum number of times transition is executed
  477.     UInt32                        fFromNodeID;
  478.     UInt32                        fToNodeID;
  479.     OSType                        fEffectType;        // the type of the effect
  480.     long                        fEffectNum;            // the number of the effect
  481.     QTAtomContainer                fEffectDesc;        // the effect description for the effect
  482.     ImageDescriptionHandle        fSampleDesc;        // the sample description for the effect
  483.     TimeBase                    fTimeBase;            // time base for the effect
  484.     TimeValue                    fTimeValue;            // time value for the effect
  485.     ImageSequence                fSequenceID;        // sequence ID for the effect
  486.     long                        fNumberOfSteps;        // number of steps in the effect
  487. } VRScriptTransition, *VRScriptTransitionPtr;
  488.  
  489.  
  490. // a list entry for our embedded picture linked list
  491. typedef struct VRScriptEmbPict {
  492.     UInt32                        fEntryType;            // kVREntry_EmbedPicture
  493.     UInt32                        fEntryID;            // a unique identifier for this entry
  494.     struct VRScriptEmbPict        *fNextEntry;        // the next entry in the list
  495.     UInt32                        fNodeID;        
  496.     UInt32                        fOptions;            // user interaction options
  497.     QTVRFloatPoint                fCenter;            // the center in the panorama of the picture screen (in angles: x = pan; y = tilt)
  498.     Rect                        fRect;                // the height and width of the embedded picture (in coordinates)
  499.     float                        fScale;                // a scale factor for the picture rectangle
  500.     float                        fWidth;                // the width (in radians) of the embedded picture; if 0, movie has no video track
  501.     Boolean                        fUseMovieGWorld;    // use the specified picture GWorld?
  502.     Boolean                        fCompositeMovie;    // does the embedded picture need to be composited?
  503.     Boolean                        fUseHideRegion;        // use the specified picture hide region?
  504.     RGBColor                    fChromaColor;        // the color for chroma key compositing
  505.     RgnHandle                    fHideRegion;        // the region that obscures the embedded picture
  506.     char                        *fPathname;
  507. } VRScriptEmbPict, *VRScriptEmbPictPtr;
  508.  
  509.  
  510. //////////
  511. //
  512. // function prototypes
  513. //       
  514. //////////
  515.  
  516. void                VRScript_OpenScriptFile (WindowObject theWindowObject, char *theFileName);
  517. #if TARGET_OS_WIN32
  518. void                VRScript_OpenCommandLineScriptFile (LPSTR theCmdLine);
  519. #endif
  520. void                VRScript_FindAndOpenQTVRMovieFile (FSSpec *theFSSpecPtr);
  521. void                VRScript_ProcessScriptCommandLine (WindowObject theWindowObject, char *theCommand);
  522. void                VRScript_SetCurrentDirectory (FSSpecPtr theFSSpecPtr);
  523. void                VRScript_SetCurrentMovie (WindowObject theWindowObject, UInt32 theOverlayType, UInt32 theNameType, UInt32 theOptions, char *thePathName);
  524. void                VRScript_SetControllerBarState (WindowObject theWindowObject, Boolean theState, UInt32 theOptions);
  525. void                VRScript_SetControllerButtonState (WindowObject theWindowObject, UInt32 theButton, Boolean theState, UInt32 theOptions);
  526. void                VRScript_SetResizeState (WindowObject theWindowObject, Boolean theState, UInt32 theOptions);
  527. void                VRScript_SetAngleConstraints (WindowObject theWindowObject, UInt16 theKind, float theMinAngle, float theMaxAngle, UInt32 theOptions);
  528. short                VRScript_OpenResourceFile (WindowObject theWindowObject, UInt32 theOptions, char *thePathName);
  529. VRScriptSoundPtr    VRScript_EnlistSound (WindowObject theWindowObject, UInt32 theNodeID, UInt32 theResID, UInt32 theEntryID, UInt32 theMode, UInt32 theFade, UInt32 theOptions, SndChannelPtr theChannel, SndListHandle theResource);
  530. VRScriptSoundPtr    VRScript_EnlistLocalizedSound (WindowObject theWindowObject, UInt32 theNodeID, UInt32 theResID, UInt32 theEntryID, float theX, float theY, float theZ, float theProjAngle, UInt32 theMode, UInt32 theFade, UInt32 theOptions, SndChannelPtr theChannel, SndListHandle theResource, SSpSourceReference theSource);
  531. VRScriptMoviePtr    VRScript_EnlistMovie (WindowObject theWindowObject, UInt32 theNodeID, UInt32 theEntryID, float thePanAngle, float theTiltAngle, float theScale, float theWidth, UInt32 theKeyRed, UInt32 theKeyGreen, UInt32 theKeyBlue, Boolean theUseBuffer, Boolean theUseCenter, Boolean theUseKey, Boolean theUseHide, Boolean theUseDir, Boolean theRotate, float theVolAngle, UInt32 theMode, UInt32 theOptions, char *thePathName);
  532. void                VRScript_Enlist3DObject (WindowObject theWindowObject, TQ3GroupObject theGroup, UInt32 theEntryID, float theX, float theY, float theZ, UInt32 theOptions);
  533. VRScriptPicturePtr    VRScript_EnlistOverlayPicture (WindowObject theWindowObject, UInt32 theResID, UInt32 theEntryID, UInt32 theHeight, UInt32 theWidth, UInt32 thePegSides, UInt32 theOffset, PicHandle theResource, UInt32 theOptions);
  534. void                VRScript_EnlistTimedCommand (WindowObject theWindowObject, UInt32 theTicks, UInt32 theMode, UInt32 theNodeID, UInt32 theRepeat, UInt32 thePeriod, SInt32 theMaxTimes, UInt32 theOptions, char *theCmdLine);
  535. void                VRScript_EnlistQuitCommand (WindowObject theWindowObject, UInt32 theOptions, char *theCmdLine);
  536. void                VRScript_EnlistMouseOverHSCommand (WindowObject theWindowObject, UInt32 theNodeID, UInt32 theHotSpotID, OSType theHotSpotType, SInt32 theMaxTimes, UInt32 theOptions, char *theCmdLine);
  537. void                VRScript_EnlistClickHSCommand (WindowObject theWindowObject, UInt32 theNodeID, UInt32 theHotSpotID, OSType theHotSpotType, SInt32 theMaxTimes, UInt32 theOptions, char *theCmdLine);
  538. void                VRScript_EnlistClickCustomButtonCommand (WindowObject theWindowObject, UInt32 theNodeID, SInt32 theMaxTimes, UInt32 theOptions, char *theCmdLine);
  539. void                VRScript_EnlistClickSpriteCommand (WindowObject theWindowObject, UInt32 theNodeID, SInt32 theMaxTimes, UInt32 theOptions, char *theCmdLine);
  540. void                VRScript_EnlistNodeEntryCommand (WindowObject theWindowObject, UInt32 theNodeID, SInt32 theMaxTimes, UInt32 theOptions, char *theCmdLine);
  541. void                VRScript_EnlistNodeExitCommand (WindowObject theWindowObject, UInt32 theFromNodeID, UInt32 theToNodeID, SInt32 theMaxTimes, UInt32 theOptions, char *theCmdLine);
  542. void                VRScript_EnlistAngleCommand (WindowObject theWindowObject, UInt32 theKind, UInt32 theNodeID, float theMinAngle, float theMaxAngle, SInt32 theMaxTimes, UInt32 theOptions, char *theCmdLine);
  543. void                VRScript_EnlistVariable (WindowObject theWindowObject, char *theVarName, UInt32 theVarValue);
  544. void                VRScript_EnlistTransitionEffect (WindowObject theWindowObject, UInt32 theFromNodeID, UInt32 theToNodeID, SInt32 theMaxTimes, OSType theEffectType, long theEffectNum, UInt32 theOptions);
  545. void                VRScript_DelistEntry (WindowObject theWindowObject, VRScriptGenericPtr theEntryPtr);
  546. void                VRScript_DeleteListOfType (WindowObject theWindowObject, UInt32 theEntryType);
  547. void                VRScript_DeleteAllLists (WindowObject theWindowObject);
  548. VRScriptGenericPtr    VRScript_GetObjectByEntryID (WindowObject theWindowObject, UInt32 theEntryType, UInt32 theEntryID);
  549. VRScriptVariablePtr    VRScript_GetVariableEntry (WindowObject theWindowObject, char *theVarName);
  550. void                VRScript_InstallHotSpotInterceptProc (QTVRInstance theInstance, WindowObject theWindowObject);
  551. void                VRScript_InstallPrescreenRoutine (QTVRInstance theInstance, WindowObject theWindowObject);
  552. void                VRScript_InstallBackBufferImagingProc (QTVRInstance theInstance, WindowObject theWindowObject);
  553. void                VRScript_InstallInterceptRoutine (QTVRInstance theInstance, WindowObject theWindowObject);
  554. void                VRScript_InstallMouseOverHotSpotProc (QTVRInstance theInstance, WindowObject theWindowObject);
  555. void                VRScript_RemoveBackBufferImagingProc (QTVRInstance theInstance, WindowObject theWindowObject);
  556. PASCAL_RTN void        VRScript_HotSpotInterceptProc (QTVRInstance theInstance, QTVRInterceptPtr theMsg, WindowObject theWindowObject, Boolean *theCancel);
  557. PASCAL_RTN OSErr    VRScript_PrescreenRoutine (QTVRInstance theInstance, WindowObject theWindowObject);
  558. PASCAL_RTN OSErr    VRScript_BackBufferImagingProc (QTVRInstance theInstance, Rect *theRect, UInt16 theAreaIndex, UInt32 theFlagsIn, UInt32 *theFlagsOut, WindowObject theWindowObject);
  559. PASCAL_RTN void        VRScript_InterceptRoutine (QTVRInstance theInstance, QTVRInterceptPtr theMsg, WindowObject theWindowObject, Boolean *cancel);
  560. PASCAL_RTN OSErr    VRScript_EnteringNodeProc (QTVRInstance theInstance, UInt32 theNodeID, WindowObject theWindowObject);
  561. PASCAL_RTN OSErr    VRScript_LeavingNodeProc (QTVRInstance theInstance, UInt32 fromNodeID, UInt32 toNodeID, Boolean *theCancel, WindowObject theWindowObject);
  562. PASCAL_RTN OSErr    VRScript_MouseOverHotSpotProc (QTVRInstance theInstance, UInt32 theHotSpotID, UInt32 theFlags, WindowObject theWindowObject);
  563. PASCAL_RTN void        VRScript_MoviePrePrerollCompleteProc (Movie theMovie, OSErr thePrerollErr, void *theRefcon);
  564. void                VRScript_CheckForTimedCommands (WindowObject theWindowObject);
  565. void                VRScript_CheckForClickCustomButtonCommands (WindowObject theWindowObject, EventRecord *theEvent);
  566. Boolean                VRScript_CheckForClickSpriteCommands (WindowObject theWindowObject, EventRecord *theEvent);
  567. void                VRScript_CheckForAngleCommands (WindowObject theWindowObject);
  568. void                VRScript_CheckForExpiredCommand (WindowObject theWindowObject, VRScriptGenericPtr thePointer);
  569. void                VRScript_DumpUnexpiredCommands (WindowObject theWindowObject, UInt32 theNodeID);
  570. void                VRScript_PackString (char *theString);
  571. void                VRScript_UnpackString (char *theString);
  572. void                VRScript_DecodeString (char *theString);
  573. OSType                VRScript_StringToOSType (char *theString);
  574. char *                VRScript_OSTypeToString (OSType theType);
  575. Boolean                VRScript_FloatsAreEqual (float theFloat1, float theFloat2, float theTolerance);
  576.